import logging

from flask import session
from flask_script import Manager
from flask_migrate import Migrate, MigrateCommand
from info import create_app, db, models

# 通过传递参数指定配置
app = create_app("developement")
# 使用flask_script来接管app的启动
manager = Manager(app)
migrate = Migrate(app, db)      # 关联flask应用与数据库对象
manager.add_command("db", MigrateCommand)     # 给flask_script里面增加数据库迁移命令

if __name__=="__main__":
    # app.run()
    manager.run()